<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'web_site/web_page/just_headers_view.class.php');


require_once($WSC->get_site_inc_dir().'modules/admin_panel/site_admin_ajax_form_ctrl_with_object_ua.class.php');
require_once('menu_item_type_form_ctrl.class.php');


class Menu_Item_Type_Form_Ajax_Ctrl extends Site_Admin_Ajax_Form_Ctrl_With_Object_UA {
	protected function on_good_submit() {
		$object = $this->form_ctrl->get_object();
		$redir = $this->create_redirect_composer('admin/modules/tangra_cms/menu/menu_item_types.php');

		$location = $redir->get_target_address($this->get__context());

		$ret = array('command' => Ajax_Ctrl::COMMAND_REDIRECT, 'command_value' => $location);

		return $ret;
	}


	protected function create_form_ctrl() {
		$tvm = $this->get_tvm();
		$dbc = $this->get_dbc();

		$ret = new Menu_Item_Type_Form_Ctrl('menu_item_type', $tvm, $dbc, 'obj_id', $this->_config->get_htdocs_dir(), $this->_config->get_hidden_dir().'inc/');

		return $ret;
	}
}